<template>
  <div>
    <!-- 1.Vue3框架默认会自动传入event对象, 可以在方法中获取 -->
    <button @click="btn1Click">自动传入event对象</button>
    <!-- 2.手动传入event对象：$event是事件发生时的事件对象，固定$event语法 -->
    <button @click="btn2Click($event, '张三', 18)">手动传入event对象</button>
  </div>
</template>

<!-- <script>
export default {
  name: 'voncc',
  data() {
    return {
      counter: 100
    }
  },
  methods: {
    btn1Click(event) {
      console.log(event)
    },
    btn2Click(event, name, age) {
      console.log(event, name, age)
    }
  }
}
</script> -->
<script setup>
defineOptions({
  name: 'voncc'
})

const btn1Click = (event) => {
  console.log(event)
}
const btn2Click = (event, name, age) => {
  console.log(event, name, age)
}
</script>

<style lang="scss" scoped></style>
